package com.project.service.impl;

import com.feemanage.service.ISysSnruleService;
import com.project.domain.entity.xjProject.BizXjProject;
import com.project.mapper.xjProject.XjProjectMapper;
import com.project.service.IXJProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("biz_xj_project")
public class XJProjectServiceImpl implements IXJProjectService {
    @Autowired
    private ISysSnruleService sysSnruleService;

    @Autowired
    XjProjectMapper xjProjectMapper;
    /**
     * 纵向项目申请审核通过后 项目编号赋值
     * @param tableName
     * @param businessId
     * @param checkStatus
     * @param sysUserId
     */
    @Override
    public void updateBusinessStatus(String tableName, String businessId, String checkStatus, String sysUserId){
        try{
            if(checkStatus.equals("2")){
                String proCode = sysSnruleService.generateCode("2", businessId);
                BizXjProject bizXjProject = new BizXjProject();
                bizXjProject.setCode(proCode);
                bizXjProject.setId(businessId);
                xjProjectMapper.updateById(bizXjProject);
            }
        }catch (Exception exception){
            String ex = exception.getMessage();
        }
    }
}
